-
Notifications
You must be signed in to change notification settings - Fork 13
Completed hw #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Completed hw #12
Conversation
codecodecoder78
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please try to run your code to ensure it at least starts
| def hello_world(): | ||
| return "Welcome to the database!" | ||
|
|
||
| app.run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not do anything. Please look into the correct way to start the app on the notes. app.run is correct but needs more arguments
| def get_details(id): | ||
| try: | ||
| if request.method == 'GET': | ||
| return {"Status": "Success", "Data": db[id]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens when id is not valid
| def get_details(id): | ||
| try: | ||
| if request.method == 'GET': | ||
| return {"Status": "Success", "Data": db[id]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens when id is not valid
| def register(): | ||
| username = request.args.get('username') | ||
| pw = request.args.get('passwordHash') | ||
| credentials.append({"username": username, "passwordHash": pw}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Defensive programming: Check that input is not "" or None to ensure that its a valid input
| token = request.args.get('token') | ||
| if token != None: | ||
| try: | ||
| user_details = jwt.decode(token, current_app.config['SECRET_KEY'], algorithms="HS256") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job here
No description provided.